/*
 * gtype.h
 *
 *  Created on: 2012-11-28
 *      Author: kylin
 */

#ifndef GTYPE_H_
#define GTYPE_H_

#define MPR_IO_CTRL_MAGIC 'x'
#define MPR_IO_IN 				_IOR(MPR_IO_CTRL_MAGIC, 0,int)
#define MPR_IO_OUT_LOW				_IOW(MPR_IO_CTRL_MAGIC, 1,int)
#define MPR_IO_OUT_HIGH				_IOW(MPR_IO_CTRL_MAGIC, 2,int)


#define	DPR_LED_CTRL_MAGIC 'y'
#define DPR_TURN_ON_LED 			_IOW(DPR_LED_CTRL_MAGIC, 0,int)
#define DPR_TURN_OFF_LED 			_IOW(DPR_LED_CTRL_MAGIC, 1,int)


#define MPR_LCD_MAGIC 'w'
#define MPR_LCD_WRITE_DATA 			_IOW(MPR_LCD_MAGIC, 0,int)
#define MPR_LCD_WRITE_CTRL			_IOW(MPR_LCD_MAGIC, 1,int)

enum RunningState
{
	rsRun=1,
	rsMaintain=2,
};

enum KeyCode
{
	keyNone=0xFF,
	keyUp=0xEF,
	keyDown=0xAF,
	keyLeft=0xE3,
	keyRight=0xA3,
	keyAdd=0xCF,
	keySub=0xC3,
	keyEnter=0xF7,
	keyCancel=0xB7,
	keyRevert=0xD7,
};

typedef struct _tParmLockEntry
{
	unsigned short addrWiring;
	unsigned short addrMain;
	unsigned short addrLink;
	unsigned short switchNum;
}ParmLockEntry;

typedef struct _tDprAlarmEvent
{
	int alarmCode;
	unsigned short time;
	int mSecond;
}DprAlarmEvent;

typedef struct _tDprSoeEvent
{
	int lockAddr;
	int lockIndex;
	int switchNum;
	int switchState;
	unsigned short time;
	int mSecond;
}DprSoeEvent;

#endif /* GTYPE_H_ */
